package com.kaohe.service;

import java.util.List;

import com.kaohe.dao.LoginDao;
import com.kaohe.domain.PageBean;
import com.kaohe.domain.User;

public class LoginService{

	private LoginDao dao=new LoginDao();
	
	
	//登录
	public User login(String username, String password) {
 		return dao.login(username,password);
	}


	//用户管理分页查询
	public PageBean<User> uquery(PageBean<User> pb) {
		//1.查询总条数
		int count= dao.uCount();
		
		//2.查询当前页的数据
		List<User>result =dao.uquery(pb.getStartIndex(),pb.getPageSize());
		
		//3.封装pageBean
		pb.setTotalRecord(count);
		pb.setResult(result);
		
 		return pb;
	}

	//根据id删除信息
	public void deUser(String uid) {
		dao.deUser(uid);
	}

}

